#ifndef CPUID_H
#define CPUID_H

struct cpuid_cache_s
{
    uint8_t  level;
    uint8_t  type;
    
    uint8_t  ways;
    uint8_t  partitions;
    uint16_t line_size;
    uint32_t sets;
    
    uint32_t cache_size;
};

struct cpuid_s
{
    uint32_t max_basic_input,
             max_ext_input;
    uint8_t  cpu_signature[13];
    
    uint8_t  stepping, 
             model,
             family,
             type,
             ext_model,
             ext_family;
    uint16_t cache_line_size;
    uint32_t features_ecx, features_edx;
    
    uint8_t  cpu_brand[49];

    struct   cpuid_cache_s cache_info[32];
    uint8_t  cache_count;
    
    uint8_t  l2_assoc;
    uint16_t l2_cache_size;
    uint8_t  l2_cache_line_size; 
} cpuid;

void parse_cpuid(void);

#endif
